package nio;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class NioDemo {

	public static void main(String[] args) {
		Path path = Paths.get("C:/workspace");
		System.out.println("文件节点数:" + path.getNameCount());
		System.out.println("文件名称:" + path.getFileName());
		System.out.println("文件根目录:" + path.getRoot());
		System.out.println("文件上级关联目录:" + path.getParent());

		try {
			Files.copy(Paths.get("C:/a.txt"), Paths.get("C:/b.txt"));
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
